function [newBackupPathTable] = insertBackupPathNodes(backupPathTable, pathBetweenTwoNodes,n1,n2, node)

        newBackupPathTable = zeros(1,1);
        k = length(backupPathTable);       
        l = length(pathBetweenTwoNodes); 
        index = find(backupPathTable == n1);
        counter = 1;
        secondNode = 0;
        start = 1;
        for i = start:k
           if i == index
               newBackupPathTable(counter) = backupPathTable(i);
               counter = counter + 1;               
               for j = 2:l
                   if pathBetweenTwoNodes(j) ~= n2
                       newBackupPathTable(counter) = pathBetweenTwoNodes(j);
                       counter = counter + 1; 
                       secondNode = 1;
                   end
               end
           else
               if   secondNode ~= 1
                   newBackupPathTable(counter) = backupPathTable(i);
                   counter = counter + 1;   
                   start = counter;
               end  
               
           end
        end
        start = start + 2;
        for j = start:k
             newBackupPathTable(counter) = backupPathTable(j);
             counter = counter + 1;
        end
end